#pragma once

#include <istream>
#include <deque>
#include <string>
#include <optional>


namespace book
{

class LineReader
{
public:
    LineReader(std::istream &in)
        : in_(in) {}

    std::optional<std::string> next();

    void putback(std::string &&line);

private:
    std::istream &in_;
    std::deque<std::string> bufferedLines_;
};

} // namespace book
